import java.util.Arrays;

//旋转数组

class Solution {
    public void rotate(int[] nums, int k) {
        int n = nums.length;
        int[] ret = new int[n];
        for (int i = 0; i <n; i++) {
            ret[(i+k)%n] = nums[i] ;
        }
        System.arraycopy(ret, 0, nums, 0, n);
    }
}




public class Main {
    public static void main(String[] args) {
          int[]  nums = {1,2,3,4,5,6,7};
        Solution solution = new Solution();
     solution.rotate(nums,3);
        System.out.println(Arrays.toString(nums));
    }
}